==========================================
unittest
==========================================
test yor S/W driver

==========================================
code location
==========================================
apollo\sdk\unittest\

[for RTL API test]
apollo\sdk\unittest\dal\dal_xxx_test_case.c
apollo\sdk\unittest\dal\dal_xxx_test_case.h

[for RAW driver API test]
apollo\sdk\unittest\dal\raw\apollo\dal_raw_xxx_test_case.c
apollo\sdk\unittest\dal\raw\apollo\dal_raw_xxx_test_case.h


==========================================
coding function body code
==========================================
b dal_raw_xxx_test_case.c [Jnժ raw driver test case



===========================
OSAL access Utility:
===========================
osal_alloc
osal_free
osal_printf

osal_strlen 
osal_strcmp 
osal_strcpy 
osal_strncpy
osal_strcat 
osal_strchr 
osal_memset 
osal_memcpy 
osal_memcmp 


==========================================
Add your test function in test command
==========================================
1.add your test case in 
  apollo\sdk\unittest\sdk\sdk_test.c

 
unit_test_case_t unitTestCase[] = 
{
    ...
    UNIT_TEST_CASE(28001, dal_gpon_sn_test, GRP_ALL|GRP_GPON),
    ...
    
    UNIT_TEST_CASE([your test ID], [your_test_function_test], GRP_ALL|GRP_[your_module]),
                   ^^^^^^ Цۦ}
}


2.add 
#include <dal/raw/apollo/dal_raw_xxx_test_case.h>
in apollo\sdk\unittest\sdk\sdk_test.c

note:
T{Amodule b HUfunction, _hЦۦ[JAmodule

int32
sdktest_run(uint32 unit, uint8 *pStr)
{
    ...
    else if (!osal_strcmp(pStr, "qos"))
        groupmask = GRP_QOS;
    ...
}

==========================================
make your code
==========================================
1.add your file in
apollo\internal\apollo\diagShellCygwin\build\Makefile.ut

2.bؿ  
  apollo\internal\apollo\diagShellCygwin\
make unittest
 
3.make diag 
(or make all, YwgLmake all iHmake diag Ѭbuild codeɶ)


==========================================
How to Test
==========================================
diag shell test

RTK.0> sdk test case_id <UINT:start> { <UINT:end> }

RTK.0> sdk test group <STRING:item>

 